<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>07-Vue监听器</title>
    <!--①监听简单类型数据的变化-->
</head>
<body>
<div id="app">
    <input type="text" v-model="info" @change="fn1()">
</div>

</body>
<script src="js/vue.js"></script>
<script>

    var vue = new Vue({
        el: "#app",
        data: {
            info: ""
        },
        methods: {
            fn1() {
                console.log("change新值 : " + this.info)
            }
        },
        watch: {
            info(newVal, oldVal) {
                console.log("新值 : " + newVal);
                console.log("老值 : " + oldVal);
            }
        }
    })

</script>
</html>